package com.tarena.lbs.stock.web.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tarena.lbs.pojo.stock.po.CouponStockPO;
import org.apache.ibatis.annotations.Update;

public interface CouponStockMapper extends BaseMapper<CouponStockPO> {
    @Update("update coupon_stock set num=num-1 where coupon_id=#{couponId} and num>0")
    int updateStockByCouponId(Integer couponId);
}
